from math import *

import sys

n = int(input())
for i in range(int(sqrt(n)) + 1):
    for j in range(i, int(sqrt(n - i * i)) + 1):
        for k in range(j, int(sqrt(n - i * i - j * j))):
            l = sqrt(n - i * i - j * j - k * k)
            if l < k:
                break
            if int(l) == l:
                print(i, j, k, int(l))
                sys.exit(0)
